/**
 * 
 */
package com.uaroadshow.api.servcice;

import java.util.List;

import com.demo2do.core.entity.page.Page;
import com.demo2do.core.persistence.support.QueryBuilder;
import com.demo2do.core.persistence.support.QueryFilter;
import com.demo2do.core.persistence.support.QueryOrder;
import com.demo2do.core.service.GenericService;

/**
 * @author Wilson
 *
 * @param <T>
 */
public interface DataService<T> extends GenericService<T> {
    
    /**
     * @param clazz
     * @return
     */
    public int count(Class<T> clazz);

    /**
     * @param clazz
     * @param queryFilter
     * @return
     */
    public int count(Class<T> clazz, QueryFilter queryFilter);

    /**
     * 
     * @param clazz
     * @return
     */
    public List<T> listAll(Class<T> clazz);

    /**
     * 
     * @param clazz
     * @param page
     * @return
     */
    public List<T> listByPage(Class<T> clazz, Page page);
    
    /**
     * 
     * @param clazz
     * @param queryOrder
     * @param page
     * @return
     */
    public List<T> listByPage(Class<T> clazz, QueryOrder queryOrder, Page page);
    
    /**
     * 
     * @param clazz
     * @param queryFilter
     * @param queryOrder
     * @param page
     * @return
     */
    public List<T> listByPage(Class<T> clazz, QueryFilter queryFilter, QueryOrder queryOrder, Page page);
    
    /**
     * 
     * @param clazz
     * @param code
     * @return
     */
    public T load(Class<T> clazz, String code);
    
    /**
     * 
     * @param clazz
     * @param code
     * @param orgIds
     * @return
     */
    public T load(Class<T> clazz, String code, List<Long> orgIds);

    /**
     * @param clazz
     * @param queryBuilder
     * @param page
     * @return
     */
    public List<T> search(Class<T> clazz, QueryBuilder queryBuilder, Page page);
    
}
